package com.hdax.dm.service;

import com.hdax.dm.dto.base.CarouselDto;
import com.hdax.dm.feign.base.ImageFeign;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class ImageService {

    @Autowired
    private ImageFeign imageFeign;

    public List<com.hdax.dm.vo.CarouselDto> carousel(){
        List<CarouselDto> lists = imageFeign.carousel();
        List<com.hdax.dm.vo.CarouselDto> listDto = new ArrayList<>();
        lists.forEach(list->{
            com.hdax.dm.vo.CarouselDto dto = new com.hdax.dm.vo.CarouselDto();
            BeanUtils.copyProperties(list,dto);
            listDto.add(dto);
        });
        return listDto;
    }

}